package com.example.SpringBootMybatis.controller;

import com.example.SpringBootMybatis.common.Result;
import com.example.SpringBootMybatis.entity.Gene;
import com.example.SpringBootMybatis.entity.GeneScore;
import com.example.SpringBootMybatis.entity.Params;
import com.example.SpringBootMybatis.service.GeneService;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping
public class GeneController {
    @Resource
    private GeneService geneService;
    @RequestMapping("/geneSearch")
    public Result findBySearch(Params params){
        PageInfo<Gene> info=geneService.findBySearch(params);
        return Result.success(info);
    }
    @RequestMapping("/geneScore")
    public Result findAll(Params params){
        PageInfo<GeneScore> info=geneService.findAll(params);
        return Result.success(info);
    }
}
